//
//  CYGHomeRcmdTableViewCell.m
//  CYGHuntForCity
//
//  Created by cygarm on 16/2/29.
//  Copyright © 2016年 cygarm. All rights reserved.
//

#import "CYGHomeRcmdCell.h"
#import <UIImageView+WebCache.h>

@interface CYGHomeRcmdCell ()

@property (weak, nonatomic) IBOutlet UIImageView *backImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *adressLabel;
@property (weak, nonatomic) IBOutlet UILabel *praiseLabel;

@end

@implementation CYGHomeRcmdCell

- (void)awakeFromNib {
	self.backgroundColor = [UIColor grayColor];
	self.selectionStyle = UITableViewCellSelectionStyleNone;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView model:(CYGHomeRcmdCellModel *)model {
	static NSString *cellID = @"idHomeRcmdCell";
	CYGHomeRcmdCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
	if (cell == nil) {
		cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
	}
	
	[cell.backImageView sd_setImageWithURL:[NSURL URLWithString:model.imageURL] placeholderImage:[UIImage imageNamed:@"ContentViewNoImages"]];
	cell.nameLabel.text = model.section_title;
	cell.adressLabel.text = model.poi_name;
	cell.praiseLabel.text = model.fav_count;
	
	return cell;
}

@end
